<template>
    <CommonModal :isVisible="isVisible" :backgroundImage="modal3Png" @close="closeModal"
        :modalStyle="{ width: '1400px', height: '780px', minWidth: '1400px' }">
        <template #buttons>
            <div class="pic-btn" @click="handleClick('1')"></div>
            <div class="video-btn" @click="handleClick('2')"></div>
            <div class="audio-btn" @click="handleClick('3')"></div>
        </template>
    </CommonModal>
</template>

<script setup>
import { ref, defineEmits } from 'vue'
import CommonModal from './CommonModal.vue'
import modal3Png from '@/assets/images/3/modal.png'

const props = defineProps({
    isVisible: {
        type: Boolean,
        default: false
    }
})

const emit = defineEmits(['close', 'click'])

const closeModal = () => {
    emit('close')
}

const handleClick = (type) => {
    emit('click', type)
}
</script>

<style lang="scss" scoped>
// 公共按钮样式
%btn-base {
    position: absolute;
    left: 52%;
    transform: translateX(-50%);
    width: 100%;
    height: 96px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    cursor: pointer;
    transition: all 0.3s ease;

    &:hover {
        transform: translateX(-50%) scale(1.05);
    }

    &:active {
        transform: translateX(-50%) scale(0.95);
    }
}

.pic-btn {
    @extend %btn-base;
    bottom: 520px;
    background-image: url('../assets/images/3/pic.png');

    &:hover {
        background-image: url('../assets/images/3/pic_active.png');
        transform: translateX(-50%) scale(1.05);
    }
}

.video-btn {
    @extend %btn-base;
    bottom: 360px;
    background-image: url('../assets/images/3/video.png');

    &:hover {
        background-image: url('../assets/images/3/video_active.png');
        transform: translateX(-50%) scale(1.05);
    }
}

.audio-btn {
    @extend %btn-base;
    bottom: 200px;
    background-image: url('../assets/images/3/audio.png');

    &:hover {
        background-image: url('../assets/images/3/audio_active.png');
        transform: translateX(-50%) scale(1.05);
    }
}
</style>